|
|
 |
 |
To access the contents, click the chapter and section titles.
Bug Proofing Visual Basic: A Guide to Error Handling and Prevention
(Publisher: John Wiley & Sons, Inc.)
Author(s): Rod Stephens
ISBN: 0471323519
Publication Date: 11/01/98
INDEX
- A
- abbreviations, variable name, 4445, 121122
- actions, simulating user, 292295, 297298
- ActiveX controls, 202, 245247
- algorithms, optimizing, 215216
- Allow Unrounded Floating-Point operations option, 222223
- & operator, 107
- And operator, 107108
- APE (Application Performance Explorer), 304
- API declarations, 210
- arguments
- default values and, 8081
- name issues, 8283
- variable promotion and, 165166
- verification of, 7377
- arrays
- assumptions, verifying, 180181
- bounds of, 111112, 220
- constants and, 6264
- enumerated values and, 6264
- LBound function and, 6566, 8689, 180
- UBound function and, 6566, 8689, 180
- variants and, 5253
- Assume No Aliasing option, 219220
- assumptions, verifying array, 180181
- attitudes, programming, 316, 283
- automatic reference counting, 151152, 197
- automatic result verification, 9697
- automatic variable declaration, 3738
- B
- Bad1 example code, 1516, 329333
- Bad10 example code, 211213, 366371
- Bad11 example code, 224225, 371373
- Bad12 example code, 249251, 373379
- Bad13 example code, 272274, 379383
- Bad15 example code, 311312, 383384
- Bad16 example code, 324326, 385386
- Bad3 example code, 5859, 334338
- Bad4 example code, 6971, 338341
- Bad5 example code, 9799, 341346
- Bad6 example code, 124126, 347351
- Bad8 example code, 167169, 355359
- Bad9 example code, 189193, 359366
- .BAS modules, 130, 199
- black box testing method, 278, 281
- blank lines, adding to code, 178180
- Boolean operators, 107108
- Break in Class Module option, 248
- Break on All Errors option, 248
- Break on Unhandled Errors option, 248
- break options, Visual Basic, 248
- bug logs, 2021
- ByRef keyword
- parameter declarations, 114115, 186187
- raising errors with, 181182
- ByVal keyword
- parameter declarations, 114115, 186187
- raising errors with, 181182
- C
- capitalization, variable name, 45
- Case Else causes, 68
- CBool conversion function, 108
- CInt conversion function, 108
- circular references, 151152
- Class_Initialize event handler, 196197
- Class_Terminate event handler, 196197
- classes
- encapsulation of, 195196
- event handlers and, 196197, 198
- Implements keyword and, 200201
- RoutineInfo, 260
- validation of, 93
- variants and, 5253
- .CLS modules, 130
- code
- arrays. See arrays
- comment files, 129143, 387389
- constants, 6171, 7577, 238
- controls, 117, 202, 245247, 256
- conversion functions, 108
- data types. See data types
- debug and nondebug, separating, 187188
- duplicate, 204, 209210
- encapsulation of, 195214
- enhancements, addition of, 174175
- enumerated values, 6171
- error handling. See error handling
- errors in
- documentation of, 298299
- estimating finding time, 282, 296297
- estimating number of, 295296
- faking during testing, 290
- example code. See example program code
- fixing own, 292
- format of
- indentations, 178180
- line continuation, 116117
- parentheses, 108
- spacing, 110111
- syntax, 157
- invalid, error notification of, 8485
- keyboard shortcuts, 289
- offensive vs. defensive, 1112
- operators, correct use of, 107108
- order of actions in, 119120
- parameters. See parameters
- prepackaged tools and, 175177
- profiling with VBCP, 221222, 303313
- analyzing results of, 307311
- checking code coverage, 295
- debugging habits and, 315327
- instructions for, 306307
- optimization and, 216217
- self-test, 311312, 384386
- random behavior in, 117119
- restrictions, adding, 8586
- review process, 278, 280281, 290292
- side effects, 103105
- standardization of, 3334
- testing of, 277302
- anticipating results of, 290
- black box method, 278, 281
- code review method, 278, 280281
- code step through method, 278, 279280
- of dummy routines, 297298
- input checking method, 278, 281
- code, testing of (Continued)
- planning, 283
- scope issues, 278279
- self-tests, 300301, 382383
- stack trace messages, 258265
- user actions, simulating, 292295, 297298
- white box method, 278, 282
- writing routines for, 283284
- tricks in, 101103
- uniformity and simplicity of, 173174, 175
- validation of
- application results, 9697
- arguments, 7377
- classes, 93
- data, 8993
- forms, 93
- optional parameters, 7880
- ParamArray, 8384
- variables. See variables
- variants and, 36, 5053, 5455
- wizards for, 120121
- Code Profiler, Visual Basic (VBCP), 303313
- analyzing results of, 307311
- checking code coverage, 295
- installation of, 303304
- instructions for, 306307
- methodology of, 305
- optimization and, 216217
- code review test method, 278, 280281
- code step through test method, 278, 279280
- code wizards, 120121
- : (command separator), 110111
- commands, spacing of, 110111
- comment files, 129143
- contents of, 130134
- context of, 137
- debugging, adding during, 317318
- deletion of, 139
- for event handlers, 136137, 391
- for functions, 134136, 390391
- operating system compatibility, 138
- optimizations, adding to, 217218
- for routines, 134136, 390391
- self-test, 141142, 350354
- style of communication in, 138139
- templates for, 135136, 137, 387389
- text formatting in, 139140
- Common Dialog Control, 182
- constants, 6168, 6971
- adding to code, 6768
- arrays and, 6364
- Bad4 example code, 6971, 339342
- DEBUG_MODE, 7577
- defining error, 238
- deletion of, 6768
- grouping of, 69
- MAX, 6465
- naming issues, 6667
- NUM, 6465
- control arrays. See also arrays
- LBound function and, 6566, 8689
- UBound function and, 6566, 8689
- control type prefixes, 41, 42, 43
- Control variables, 48
- controls
- ActiveX, 202, 245247
- default properties, 117
- error events, catching with, 256
- conversion functions, 108
- copyright information, 130
- Ctrl-F9 shortcut, 289
- D
- daily schedule, sample, 333334
- data types
- Hungarian notation and, 41
- mixing of, 105106
- nonspecific, 4950
- selecting, 4849
- user-defined (UDTs), 201202
- variants and, 5055
- data validation, 8993
- in classes, 93
- in forms, 93
- at shutdown, 9091
- at startup, 9091
- subroutine structure and, 8990
- while running, 9293
- databases, saving errors in, 267270
- date loops, 149150
- DBErr program, 268
- DEBUG_MODE variable, 7577
- Debug.Assert statements, 7475, 88, 180, 181
- debugger, Visual Basic, 279280
- debugging code, 187188. See also code
- anticipating test results, 290
- black box method, 278, 281
- code review method, 278, 280281
- code step through method, 278, 279280
- compatibility issues, 285286
- with dummy routines, 297298
- errors
- analysis and documentation of, 298299
- estimating finding time of, 296297
- estimating numbers of, 295296
- faking during testing, 290
- fixing own, 316317
- global variables and, 282
- input checking method, 278, 281
- optimization and, 218
- planning tests, 283
- scope issues, 278279
- self-test example, 300301
- successful habits for, 315327
- test routines, writing, 283284
- user actions, simulating, 292295, 297298
- white box method, 278, 282
- declarations. See also names
- encapsulation of, 210
- listing in headers, 131132
- variable, 36, 3738, 4849
- DefBool statements, 39
- DefInt statements, 39
- DefLng statements, 39
- Deftype statements, 33, 3940
- dependencies in comment files, 130131
- descriptions in comment files, 130
- design issues, 173193
- assumptions, verifying, 180181
- Bad9 example program, 189193, 358365
- code uniformity and simplicity, 173174, 175
- debug and nondebug code, separating, 187188
- decision making process, 185
- features, adding additional, 174175
- FreeFile and, 185186
- invalid situations and errors, 181183
- multipurpose variables and, 183184
- optimization of design and, 177178
- prepackaged tools and, 175177
- status codes and, 182
- tasks, separation of, 184185
- text of code, 178180
- development process
- Bad1 example program, 1516, 329333
- catching bugs early in, 5
- coding, designing before, 2429
- distractions during, 3031
- documentation methods, 1921, 2223
- maintaining control during, 57
- optimization, deferring, 910
- prioritizing tasks, 59
- testing during, 279
- Dim statements, 113114
- dimension arrays. See arrays
- distractions during programming, 3031
- division by zero, 165, 221222
- documentation methods, 1921, 2223
- DoEvents statements, 9091
- dummy routines, testing, 297298
- duplicate code, 204, 209210
- E
- email, error notification by, 270272
- Else statements, 68, 9596
- encapsulation, 195214
- ActiveX controls and, 202
- Bad10 example code, 211213, 366371
- of classes, 196
- of errors, 205206
- Implements keyword and, 200201
- modules and, 203
- objects and, 196197, 198
- property procedures and, 198199
- property values and, 207208
- repeating code and, 209210
- With statements, 208209
- subroutines and, 203204
- tracking interactions in, 195196
- user-defined types (UDTs), 201202
- variables and, 206207
- End statements, 155156
- End Function, 231, 235
- End Property, 231, 235
- End Sub, 231, 235
- enhancements, adding additional, 174175
- entry points, listing in header, 130131
- enumerated values, 6171
- adding, 6768
- Bad4 example program, 6971, 339342
- debugging example, 6971
- defining, 6869
- defining status codes with, 182
- dimension arrays and, 6364
- grouping, 69
- naming protocols, 6667
- removing, 6768
- enums. See enumerated values
- equality tests, 145148
- error codes, 166167, 238
- error handling, 227251, 253274. See also errors
- array bounds checks, 220
- Bad12 example code, 249251, 373379
- Bad13 example code, 272273, 378382
- break options, Visual Basic, 248
- bugproofing of, 241242
- cleaning up after errors, 243245
- controls and, 256
- e-mail, error notification by, 270272
- error constants, defining, 238
- error messages, presenting, 256258
- Err.Raise statements, 181, 231, 235238
- exiting from, 163
- GoTo statements, 159160
- header comments and, 135
- invalid code notification, 8485
- nesting of handlers, 240241
- normal execution, return to, 231238
- objects and, 245247
- On Error statements, 229231
- optimizations, Visual Basic, 218224
- saving errors to
- databases, 267270
- files, 265267
- scope issues, 240
- separation of handlers, 239
- stack tracing of errors, 258265
- systematic use of handlers, 254255
- unexpected errors and, 242243
- error messages, 256258
- errors
- analysis and documentation, 2021, 298299
- catching with controls, 256
- cleaning up after, 243245
- encapsulation of, 205206
- estimating finding time, 296297
- estimating numbers of, 295296
- faking during testing, 290
- notification of by e-mail, 270272
- overflow, 164165
- raising for exceptions, 181182
- saving to
- databases, 267270
- files, 265267
- stack tracing of, 258265
- underflow, 164165
- Err.Raise statements, 181, 231, 235238
- event handlers. See also error handling
- Class_Initialize, 196197
- Class_Terminate, 196197
- comment files for, 136137
- Initialize, 198
- objects and error handling, 245247
- unexpected errors and, 242243
- user actions, simulating, 292295
- events, user
- simulating during testing, 292295
- testing user interface, 297298
- example program code
- Bad1, 1516, 329333
- Bad10, 211213, 366371
- Bad11, 224225, 371373
- Bad12, 249251, 373379
- Bad13, 272274, 379383
- Bad15, 311312, 383384
- Bad16, 324326, 385386
- Bad3, 5859, 334338
- Bad4, 6971, 338341
- Bad5, 9799, 341346
- Bad6, 124126, 346350
- Bad8, 167169, 355358
- Bad9, 189193, 358365
- exceptions, raising errors for, 181182
- exhaustive input checking test method, 278, 281
- Exit statements, 155156, 185
- Exit Function, 231, 234235
- Exit Property, 231, 234235
- Exit Sub, 161162, 231, 234235
- F
- FDIV bug, 223224
- features, adding additional, 174175
- file names, 130
- FileErr program, 265267
- files
- opening and closing, 109110
- saving errors to, 265267
- float loops, 147148
- floating-point calculations
- error checks, 221222
- unrounded operations, 222223
- For loops, 147150, 289
- Form variables, 48
- format, code
- indentations, 178180
- line continuation, 116117
- parentheses, 108
- spacing, 110111
- forms
- default properties, 117
- defining, 5558
- loading and unloading of, 152154
- validation of, 93
- variants and, 5253
- FreeFile, 185186
- .FRM modules, 130
- Function Hit Count VBCP statistics, 306, 310311
- function return types, 49
- Function Timing VBCP statistics, 306, 309
- functions
- header comments for, 134136, 388389
- LBound, 6566
- Left$, 109
- UBound, 6566
- verification of values in, 155156
- functions, variant subtype, 5455
- G
- global variables, 47, 282
- GoTo statements, 157161
- error handling and, 159160
- improper use of, 157158
- loops and, 160161
- granularities, testing at different, 278279
- H
- header comments, 129143
- adding to during debugging, 317318
- contents of, 130134
- context of, 137
- deletion of, 139
- for event handlers, 136137, 389
- for functions, 134136, 388389
- operating system compatibility, 138
- optimizations and, 217218
- for routines, 134136, 390391
- style of communication in, 138139
- templates for, 135136, 137, 387389
- text formatting in, 139140
- Hungarian notation, 4044
- I
- If statements, 7577, 119120, 185, 289
- If Then Else statements, 68, 185
- IIF statements, 163164
- Immediate window
- modifying variables in, 288
- testing subroutines within, 286
- viewing variables in, 286288
- Implements keyword, 200201
- implicit variable creation, 3738
- incorrect arguments
- Debug.Assert statements, 7475
- Stop command, 7577
- verification and, 7377
- indentation, adding to code, 178180
- inequality tests, 145148
- Initialize event handler, 198
- input checking test method, 278, 281
- input variables, 183184
- Instant Watch button, 286
- integers
- checking equality of, 145147
- controlling float loops with, 148
- correct use of, 107108
- overflow errors and, 221
- IsMissing function, 7880
- K
- keyboard shortcuts, 289
- L
- LBound function, 6566, 8689, 180
- Left$ function, 109
- library declarations, 210
- Line Hit Count VBCP statistics, 306, 309310
- Line Timing VBCP statistics, 306, 307308
- lines
- adding blank to code, 178180
- continuation characters, 116117
- debugging habits and, 319
- loops, 122124
- For, 147150, 289
- date, 149150
- decision making by, 185, 289
- float, 147148
- GoTo statements and, 160161
- reference, 151152
- resizing inside of, 150151
- While, 148, 149150, 289
- M
- magic numbers, 6163
- MailErr program, 270272
- MakeErrorMessage function, 256257
- management issues, 34
- Bad1 example code, 1516
- control issues, 57
- designing before coding, 2429
- documentation methods, 1921, 2223
- optimization, deferring, 910
- prioritizing tasks, 59
- MAPIMessages controls, 270
- MAPISession controls, 270
- MAX constant, 6465
- mental discipline
- during debugging, 315316
- during programming, 2931
- messages, error, 256258
- methods, listing in headers, 131132
- Microsoft Common Dialog Control, 182
- Mod operator, 88
- module-global variables, 46, 47, 282
- modules, encapsulation with, 203
- multiple variables, 36, 4546
- MyForm templates, 5558
- N
- names
- of constants, 6667
- of enumerated values, 6667
- of optional parameters, 8283
- of variables, 4046, 121124
- abbreviations and, 4445, 121122
- avoiding conflicts, 4546
- capitalization of, 45
- Hungarian notation and, 4044
- use of meaningful, 4445, 121122
- nested error handlers, 240241
- nested statements, 208209
- Next statements, 123124
- nondebug code, 187188
- nonspecific data types, 4950
- notebooks, using during development, 1920
- NUM constant, 6465, 87
- O
- Object variables, 48, 49
- objects
- error handling and, 245247
- system-global, 282
- tracking creation/destruction of, 196197
- On Error GoTo line statements, 229, 231
- On Error GoTo statements, 159160, 185
- On Error Resume Next statements, 229, 230
- one form, defining, 5558
- operating systems
- comment files and, 138
- testing code among multiple, 285286
- operators
- &, 107
- +, 107
- Boolean, 107108
- Mod, 88
- optimizations, 177178, 215225
- algorithms and, 215216
- Bad11 example code, 224225
- comment files, adding to, 217218
- deferring in development process, 910
- profiling and, 216217
- Visual Basic options, 218224
- Option Explicit statements, 3738
- optional parameters
- avoidance of, 8182
- default values and, 8081
- naming issues, 8283
- validation of, 7880
- Or operator, 107108
- output variables, 184, 290
- overflow errors, 164165, 221
- P
- ParamArray parameters, 8384
- parameters
- ByRef keyword, 114115
- ByVal keyword, 114115
- multipurpose, 184
- notification of invalid, 8485
- optional, 7883
- ParamArray, 8384
- routine side effects, 103105
- parentheses ( ), 108
- Pentium FDIV bug, 223224
- + operator, 107
- precision, integer, 145147
- prefix characters, 4044
- control type, 41, 42, 43
- data type, 41
- scope, 40, 41
- prepackaged programming tools, 175176
- PrintTextAt subroutine, 82
- prioritizing tasks, 59, 2223
- Private statements, 113114
- procedures
- in header comments, 134136
- property return, 49, 198199
- profiling code. See Visual Basic Code Profiler (VBCP)
- programming
- ActiveX controls, 202, 245247
- arguments
- arguments, verifying, 7377
- default values and, 8083
- variable promotion and, 165166
- arrays. See arrays
- attitudes toward, 316, 283
- classes
- encapsulation of, 195196
- event handlers and, 196197, 198
- Implements keyword and, 200201
- validation of, 93
- variants and, 5253
- code format
- indentations, 178180
- line continuation, 116117
- parentheses, 108
- spacing, 110111
- syntax, 157
- code review process, 278, 280281, 290292
- code uniformity and simplicity, 173174, 175
- comment files and, 129143, 389390
- constants, 6171, 7577, 238
- controls, 117, 202, 245247, 256
- conversion functions, 108
- daily schedule for, 333334
- data types. See data types
- debug and nondebug code, separating, 187188
- distractions during, 3031
- duplicate code, 204, 209210
- encapsulation and, 195214
- enhancements, addition of, 174175
- enumerated values, 6171
- error handling. See error handling
- example program code. See example program code
- fixing own code, 292
- keyboard shortcuts, 289
- objects, 196197, 245247, 282
- offensive vs. defensive, 1112
- operators, correct use of, 107108
- optimizations, 177178, 215225
- order of actions in, 119120
- parameters. See parameters
- prepackaged tools and, 175177
- profiling code. See Visual Basic Code Profiler (VBCP)
- random behavior in code, 117119
- restrictions, adding coding, 8586
- separation of tasks during, 184185
- side effects in code, 103105
- standardization of code, 3334
- statements. See statements
- testing code, 277302
- tricks for, 101103
- validation of
- application results, 9697
- arguments, 7377
- classes, 93
- data, 8993
- forms, 93
- optional parameters, 7880
- ParamArray, 8384
- variables. See variables
- variants and, 36, 5053, 5455
- wizards for, 120121
- programming language syntax, 157
- project management issues, 317
- catching bugs in development, 5
- control issues, 57
- designing before coding, 2429
- documentation methods, 1921, 2223
- optimization, deferring, 910
- self-test, 1516
- properties, 117, 207208
- property procedure return types, 49, 198199
- Public statements, 113114
- public variables, 198
- R
- random behavior, limiting, 117119
- random number generators, 118119
- read-only values, 198
- ReDim statements, 112
- reference counting, automatic, 151152, 197
- reference loops, 151152
- references, circular, 151152
- Remove Array Bounds Checks option, 220
- Remove Integer Floating-Point Error Checks option, 221222
- Remove Integer Overflow Checks option, 221
- Remove Safe Pentium FDIV Checks, 223224
- restrictions, adding to code, 8586
- result verification, automatic, 9697
- Resume Next statements, 233234
- Resume statement, 159160, 231
- Resume statements, 231, 232233
- reviews, code, 278, 280281, 290292
- Rnd statements, 117, 118119
- RoutineInfo class, 260
- routines. See also subroutines
- ByRef keyword, 114115
- ByVal keyword, 114115
- calculations, eliminating, 154155
- debugging habits and, 319
- encapsulating, 195196
- error handling and
- cleaning up after, 243245
- encapsulation of errors, 205206
- error status code, 182183
- preparing for unexpected, 242243
- stack trace messages, 258265
- exiting from, 161163
- files in, opening and closing, 109110
- header comments for, 134136, 390391
- naming issues, 121122
- side effects and, 103105
- static, 112113
- user actions, simulating, 292295
- values, verification of, 155156
- writing test, 283284
- S
- scope
- error handling and, 240
- Hungarian notation and, 40, 41
- limiting, 46
- Private statements, 113114
- Public statements, 113114
- testing different levels of, 278279
- variable name conflicts and, 4546
- Select statements, 120, 185, 289
- self-tests
- Bad1, 1516, 329332
- Bad10, 211213, 365370
- Bad11, 224225, 370372
- Bad12, 221222, 249251
- Bad13, 272274, 378382
- Bad15, 311312, 383384
- Bad16, 324326, 385386
- Bad3, 5859, 334338
- Bad4, 6971, 338341
- Bad5, 9799, 341346
- Bad6, 124126, 346350
- Bad8, 167169, 355358
- Bad9, 189193, 358365
- comment files, 141142, 347351
- testing application code, 300301, 382383
- SetDebugMode subroutine, 77
- shortcuts. See tricks, coding
- ShowErrorMessage function, 257258
- shutdown, data validation at, 9091
- side effects, 103105
- stack trace messages, 258265
- StackDump program, 259265
- standardization of coding syntax, 3334, 121122
- startup, data validation at, 9091
- statements
- With, 208209
- Debug.Assert, 7475, 88, 180, 181
- decision making by, 289
- DefBool, 39
- DefInt, 39
- DefLng, 39
- Deftype, 33, 3940
- Dim, 113114
- DoEvents, 9091
- Else, 68, 9596
- End, 155156
- End Function, 231, 235
- End Property, 231, 235
- End Sub, 231, 235
- On Error GoTo, 159160, 185
- On Error GoTo 0, 229, 230
- On Error GoTo line, 229, 231
- On Error Resume Next, 229, 230
- Err.Raise, 181, 231, 235238
- Exit, 155156, 185
- Exit Function, 231, 234235
- Exit Property, 231, 234235
- Exit Sub, 161162, 231, 234235
- GoTo, 157161
- If, 7577, 119120, 185, 289
- If Then Else, 68, 185
- IIF, 163164
- nested, 208209
- Next, 123124
- Option Explicit, 3738
- Private, 113114
- Public, 113114
- ReDim, 112
- Resume, 159160, 231, 232233
- Resume Next, 231, 233234
- Rnd, 117, 118119
- Select, 120, 185, 289
- Stop, 7577, 88, 180, 181
- Then Else, 163164
- TypeName, 4950
- TypeOf, 4950
- Unload, 9495
- static routines, 112113
- static variables, 47, 112113
- statistics, VCBE, 306311
- Function Hit Count, 307, 310
- Function Timing, 307, 309
- Line Hit Count, 307, 309310
- Line Timing, 307308
- status codes, defining, 182
- step through test method, 278, 279280
- Stop statements
- argument verification, 7577, 88, 180
- invalid situations and, 181
- strings, 107, 109
- subroutines. See also routines
- code, indenting text of, 178180
- data validation and, 8990
- encapsulation with, 203204
- error handling and
- cleaning up after, 243245
- preparing for unexpected, 242243
- stack trace messages, 258265
- exiting from, 161163
- header comments for, 134136
- Immediate window, testing in, 286
- user actions, simulating, 292295
- subtype functions, variant, 5455
- system-global objects, 282
- T
- tasks, separation of programming, 184185
- templates
- header comments, 387389
- for event handlers, 137, 389
- for routines and functions, 135136, 388389
- MyForm, 5558
- testers, use of separate, 290292
- testing code, 277302. See also Visual Basic Code Profiler (VBCP)
- anticipating results of, 290
- black box method, 278, 281
- code review method, 278, 280281
- code step through method, 278, 279280
- code walkthrough method, 278
- with dummy routines, 297298
- errors
- analysis and documentation of, 298299
- estimating finding time, 296297
- estimating numbers of, 295296
- faking during tests, 290
- global variables and, 282
- input checking method, 278, 281
- planning of tests, 283
- platform compatibility, 285286
- scope and, 278279
- self-tests, 300301, 383384
- test routines, writing, 283284
- user actions, simulating, 292295, 297298
- white box method, 278, 282
- text format, code
- comment files and, 139140
- indentations in, 178180
- line continuation, 116117
- line spacing, 110111
- parentheses, 108
- syntax, 157
- TextBox control, 43
- Then Else statement, 163164
- tools, prepackaged, 175176
- tricks, coding, 101103
- TypeName statements, 4950
- TypeOf statements, 4950
- types, data
- Hungarian notation and, 41
- mixing of, 105106
- nonspecific, 4950
- selecting variable, 4849
- user-defined (UDTs), 201202
- variants, 5055
- U
- UBound function, 6566, 8689, 180
- UDTs (user-defined types), 201202
- underflow errors, 164165
- Unload statement, 9495
- user actions, 292295
- user-defined types (UDTs), 201202
- user interface, 297298
- V
- validating
- arguments, 7377
- classes, 93
- data, 8993
- forms, 93
- optional parameters, 7880
- ParamArray, 8384
- results, 9697
- values
- floating-point calculations, 221222
- property, saving, 207208
- read-only, 198
- variable, assigning, 167
- variables, 3560
- argument promotion and, 165166
- assigning values to, 167
- Bad3 example code, 5859, 335338
- data types
- mixing of, 105106
- nonspecific, 4950
- selecting, 4849
- user-defined (UDTs), 201202
- date and time, 149150
- declaration of
- automatic, 3738
- explicit, 36, 4849
- Deftype statements and, 33, 3940
- encapsulation with, 206207
- forms and, 5558
- global, 47, 282
- Hungarian notation and, 4044
- Immediate window and, 286288
- initialization of, 154
- input, 183184
- looping of, 122124
- module-global, 46, 47, 282
- multiple, 36, 4546
- multipurpose, 183184
- naming issues, 4046, 121124
- Option Explicit statements, 3738
- output, 184, 290
- public, 198
- reuse of, 122123, 154155
- scope of, 4546, 113114
- sharing, 187188
- sizing of, 167
- static, 47, 112113
- unused, clearing, 9495
- variants and, 36, 5055
- variants, 36, 5053
- functions and, 109
- ParamArray parameters and, 83
- subtype functions and, 5455
- VBCP (Visual Basic Code Profiler). See Visual Basic Code Profiler (VBCP)
- vbObjectError constant, 238
- Visual Basic
- Application Performance Explorer (APE), 304
- break options in, 248
- Code Profiler. See Visual Basic Code Profiler (VBCP)
- debugger in, 279280
- optimization options, 218224
- Allow Unrounded Floating-Point operations, 222223
- array bounds checks, 218
- Assume No Aliasing, 219220
- Remove Array Bounds Checks, 220
- Remove Integer Floating-Point Error Checks, 221222
- Remove Integer Overflow Checks, 221
- Remove Safe Pentium FDIV Checks, 223224
- Visual Data Manager, 269279
- WindowProc, 294295
- Visual Basic Code Profiler (VBCP), 295, 303313
- code coverage, checking, 295
- debugging habits and, 315327
- installation of, 303304
- instructions for, 306307
- methodology of, 305
- optimization and, 216217
- results, analyzing, 307311
- self-test, 311312, 383384
- Visual Data Manager, 269279
- W
- Watch windows, 286288
- While loops, 148, 149150, 289
- white box testing method, 278, 282
- WindowProc, 294295
- With statements, 208209
- wizards, coding, 120121
- work habits, 1932. See also development process
- bug logs, 2021
- daily schedules, 333334
- distractions, minimizing, 3031
- notebooks, 1920
- saving materials, 2122
- Z
- zero, division by, 165, 221222
|